package com.ruoyi.finance.service.impl;

import com.ruoyi.finance.domain.CommissionExtend;
import com.ruoyi.finance.service.ICommissionExtendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.finance.mapper.CommissionExtendMapper;

import java.util.List;

/**
 * 提成扩展Service业务层处理
 *
 * @author admin
 * @date 2023-10-18
 */
@Service
public class CommissionExtendServiceImpl implements ICommissionExtendService
{
    @Autowired
    private CommissionExtendMapper commissionExtendMapper;

    /**
     * 查询提成扩展
     *
     * @param id 提成扩展ID
     * @return 提成扩展
     */
    @Override
    public CommissionExtend selectCommissionExtendById(Long id)
    {
        return commissionExtendMapper.selectCommissionExtendById(id);
    }

    /**
     * 查询提成扩展列表
     *
     * @param commissionExtend 提成扩展
     * @return 提成扩展
     */
    @Override
    public List<CommissionExtend> selectCommissionExtendList(CommissionExtend commissionExtend)
    {
        return commissionExtendMapper.selectCommissionExtendList(commissionExtend);
    }

    /**
     * 新增提成扩展
     *
     * @param commissionExtend 提成扩展
     * @return 结果
     */
    @Override
    public int insertCommissionExtend(CommissionExtend commissionExtend)
    {
        commissionExtend.setUpdateTime(DateUtils.getNowDate());
        return commissionExtendMapper.insertCommissionExtend(commissionExtend);
    }

    /**
     * 修改提成扩展
     *
     * @param commissionExtend 提成扩展
     * @return 结果
     */
    @Override
    public int updateCommissionExtend(CommissionExtend commissionExtend)
    {
        commissionExtend.setUpdateTime(DateUtils.getNowDate());
        return commissionExtendMapper.updateCommissionExtend(commissionExtend);
    }


    /**
     * 批量删除提成扩展
     *
     * @param ids 需要删除的提成扩展ID
     * @return 结果
     */
    @Override
    public int deleteCommissionExtendByIds(Long[] ids)
    {
        return commissionExtendMapper.deleteCommissionExtendByIds(ids);
    }

    /**
     * 删除提成扩展信息
     *
     * @param id 提成扩展ID
     * @return 结果
     */
    @Override
    public int deleteCommissionExtendById(Long id)
    {
        return commissionExtendMapper.deleteCommissionExtendById(id);
    }
}
